package com.songlanyun.modules.chain.model.dto;


import com.songlanyun.common.drive.RootEntity;
import com.songlanyun.common.drive.ValueObject;
import com.songlanyun.common.enums.ChainConstant;
import lombok.Data;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 用户积分提现入参
 *
 * @author Administrator
 */
@Data
public class UserWithdrawalDTO implements ValueObject {

    private static final long serialVersionUID = 5945895337278971125L;

    @NotBlank(message = "转入账户地址不能为空！")
    private String toAddress;

    @NotNull(message = "转账网络不能为空！")
    private ChainConstant.ChainTransferNet transferNet;

    @NotNull(message = "提现数量不能为空！")
    @DecimalMin(value = "0", message = "提现数量必须大于0")
    private BigDecimal amount;

    public void setAmount(BigDecimal amount) {
        this.amount = amount == null ? BigDecimal.ZERO : amount;
    }

    @NotNull(message = "支付方式不能为空！")
    private ChainConstant.ChainPayType payType;

    @NotNull(message = "验证码不能为空！")
    private String verfityCode;

    @NotNull(message = "支付密码不能为空！")
    private String payPassword;

    private Long uid;

    private String userName;

    private String userPhone;

    private String idNo;

    private String bankPhone;

    private String identityCard;

}
